import {Component} from '@angular/core';
import {Router} from '@angular/router';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'route-demo';

  constructor(private _router: Router){}

  navigateToProd() {
    this._router.navigate(["/product"]); // 采用变成的方式导航到product路由
  }
}
